package com.turato.observer.clean;

import com.google.gson.Gson;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author tuhao
 * @date 2021/2/9 5:52 下午
 * @desc 注册成功，发送消息观察者
 */
public class RegisterSucMsgObserver implements UserRegisterObserver {
    private static final Logger LOGGER = LoggerFactory.getLogger(RegisterSucMsgObserver.class);
    private final Gson gson = new Gson();

    @Override
    public void update(RegisterEvent event) {
        if (null == event || !event.validate()) {
            LOGGER.info("无效的消息,event:{}", gson.toJson(event));
        }
        LOGGER.info("给用户发送注册成功消息,event:{}", gson.toJson(event));
    }
}
